package NGUYENLAMSON.ARRAY;

import java.util.ArrayList;
import java.util.List;

public class Baitoan2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
			//1 Khai bao va khoi tao mang 2d 
		List<List<Double>>lisDouble=
				new ArrayList<List<Double>>();
		//2 Dua gia tri vao mang 2 chieu dong 
		//a khai bao mang mot chieu con dong 
		List<Double>lisDouble01 = new ArrayList<Double>();
		lisDouble01.add(6.5);
		lisDouble01.add(7.5);
		lisDouble01.add(8.5);
		lisDouble01.add(9.5);
		
		List<Double>lisDouble02 = new ArrayList<Double>();
		lisDouble02.add(1.5);
		lisDouble02.add(2.5);
		lisDouble02.add(3.5);
		lisDouble02.add(4.5);
		//b Dua cac mang con vao mang cha
		lisDouble.add(lisDouble01);
		lisDouble.add(lisDouble02);
		//3 hien thi gia tri trong mang 
		double dsum=0;
		for(int hang =0;hang<lisDouble.size();hang++)
			for(int cot =0 ; cot <lisDouble.get(hang).size();cot++){
				System.out.println("lisDouble["+hang+"]["+cot+"]="+
						lisDouble.get(hang).get(cot));
					dsum+=	lisDouble.get(hang).get(cot);
			}
		System.out.println("Tong gia tri cua mang ;"+dsum);
		
	}

}
